﻿using System;
using System.Collections.Generic;

namespace Malu.Entity
{
    public enum DataInputErrStatus
    {
        Warnning,
        Error,
        Right
    }
    public class DataInputErrTypeConvertor
    {
        public static DataInputErrType String2T(string text, bool ignoreCase)
        {
            return (DataInputErrType)Enum.Parse(typeof(DataInputErrType), text, ignoreCase);
        }

        public static int T2Int(DataInputErrType type)
        {
            return (int)type;
        }

        public static DataInputErrType Int2T(int n)
        {
            if (Enum.IsDefined(typeof(DataInputErrType), n))
                return (DataInputErrType)n;
            else
                throw new Exception(n + " is not defined");
        }

        public static String T2String(DataInputErrType type)
        {
            return type.ToString();
        }
    }
    /// <summary>
    /// 数据导入错误类型
    /// </summary>
    public enum DataInputErrType
    {
        Duplicate,
        Does_not_match,
        NoIDNum,
        DepartmentNoIsError,
        FieldError,
        Insert_Error,
        Edit_Error,
        Insert_Success,
        Edit_Success,
        Delete_Success,
        UserName_Duplicate,
        IDNum_Duplicate,
        NoDictionaryName,
        NoDictionaryCode,
        NoCategoryName,
        NoFoundCategory,
        DictionaryOrder,
        NoJobName,
        NoJobCode
    }
    /// <summary>
    /// Summary description for UserInput
    /// </summary>
    public class UploadClass
    {
        public UploadClass()
        {
            _RightCount = 0;
            _ErrCount = 0;
            _CompletePercentage = 0;
            _ErrDes = "";
            _OpLogList = new List<InputDataLog>();
        }
        private int _RightCount;
        public int RightCount { get { return _RightCount; } set { _RightCount = value; } }
        private int _ErrCount;
        public int ErrCount { get { return _ErrCount; } set { _ErrCount = value; } }
        private decimal _CompletePercentage;
        public decimal CompletePercentage { get { return _CompletePercentage; } set { _CompletePercentage = value; } }
        private string _ErrDes;
        public string ErrDes { get { return _ErrDes; } set { _ErrDes = value; } }
        private List<InputDataLog> _OpLogList;
        public List<InputDataLog> OpLogList { get { return _OpLogList; } set { _OpLogList = value; } }


    }

}

